<?php
/**
 * Author panxu
 * Date   2019/8/13 10:09
 */
namespace App\Utility\Pool;
use EasySwoole\Component\Pool\PoolObjectInterface;
use EasySwoole\Mysqli\Mysqli;

class MysqlConnection extends Mysqli implements PoolObjectInterface
{
    function objectRestore()
    {
        // TODO: Implement objectRestore() method.
        $this->resetDbStatus();
    }

    function beforeUse(): bool
    {
        // TODO: Implement beforeUse() method.
        return $this->getMysqlClient()->connected;
    }

    function gc()
    {
        // TODO: Implement gc() method.
        $this->resetDbStatus();
        $this->getMysqlClient()->close();
    }


}